programming4us
           
 
 
Windows

Windows Azure Storage : Account Operations

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
11/26/2010 2:49:21 PM
The storage account provides an entry point to the Queue service via the Queue service endpoint URI. At the account level of the hierarchy, the Queue service supports only one operation: List Queues. The URI of a specific account is of the format <account name>.queue.core.windows.net. Table 1 describes the List Queues operation, and Table 2 lists some important characteristics of the List Queues function.
Table 1. Queue Account Operation
OperationDescription
List QueuesThis operation gets the list of all the queues in a storage account. You can limit the number of records returned by specifying a filter on queue names and the size of the data set in the request. Table 5-4 lists all the possible URI parameters for this operation.

Table 2. Queue Account Operations Characterstics
OperationHTTP VerbCloud URIDevelopment Storage URIHTTP VersionPermissions
List QueuesGETaccount name>.queue.core.windows.net?comp=listhttp://127.0.0.1:10001/<devstorageaccount>?comp=listHTTP/1.1Only the account owner can call this operation.

<account name> is the storage account name, such as proazurestorage; and <devstorageaccount> is the account name for the development storage. The HTTP verb used in this operation is GET. The table lists the URI format for accessing the cloud Queue service as well as the development storage URI. Port 10001 is the default Queue service port in the development fabric.

The URI for the List Queues operation supports additional optional parameters, as listed in Table 3.

Table 3. List Queues URI Parameters
ParameterDescriptionExample
prefixA filter parameter for returning queues starting with the specified prefix value.http://proazurestorage.queue.core.windows.net/?comp=list&prefix=may returns queues with names starting with the prefix "may".
markerUsed for paging queue results when all results aren't returned by the Storage service either due to the default maximum results allowed (the current default is 5000), or because you specify the maxresults parameter in the URI. The marker prefix is opaque to the client application.http://proazurestorage.queue.core.windows.net/?comp=list&prefix=may&marker=/proazurestorage/testq
maxresultsThe maximum number of queues the Queue service should return. The default value is 5000. The server returns HTTP Bad Request (400) code if you specify a maxresults value greater than 5000.http://proazurestorage.queue.core.windows.net/?comp=list&prefix=may&maxresults=10

The sample REST request for List Queues in raw format looks like Listing 1.

Example 1. List Queues REST Request
GET /?comp=list&prefix=test&maxresults=50&timeout=30 HTTP/1.1
x-ms-date: Wed, 27 May 2009 04:33:00 GMT
Authorization: SharedKey proazurestorage:GCvS8cv4Em6rWMuCVix9YCsxVgssOW62S2U8zjbIa1w=
Host: proazurestorage.queue.core.windows.net
Connection: Keep-Alive


The characteristics of the REST request in Listing 5-4 are as follows:

  • The parameter comp=list at the account level of the Queue service yields the list of all the queues.

  • The prefix=test filters the results by queue names starting with "test".

  • The maxresults=50 returns 50 queues or less.

  • The x-ms-date is the UTC timestamp of the request.

  • The Authorization header contains the SharedKey of the request.

  • The Host header points to the Queue service in the cloud.

Because the request is sending a maxresults parameter, it makes sense to keep the HTTP connection alive because it's highly likely that the user will retrieve the next set of results by making another call to the Queue service.

Listing 2 shows the response for the List Queues request.

Example 2. List Queues REST Response
HTTP/1.1 200 OK
Content-Type: application/xml
Server: Queue Service Version 1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: dde8c8bd-121d-4692-a578-d8fac08e4525
Date: Wed, 17 Jun 2009 01:24:45 GMT
Content-Length: 648

<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults AccountName="http://proazurestorage.queue.core.windows.net/">
<Prefix>test</Prefix>
<MaxResults>50</MaxResults>
<Queues>
<Queue>
<QueueName>testq</QueueName>
<Url>http://proazurestorage.queue.core.windows.net/testq</Url>
</Queue>
<Queue>
<QueueName>testq1</QueueName>
<Url>http://proazurestorage.queue.core.windows.net/testq1</Url>
</Queue>
<Queue>
<QueueName>testq2</QueueName>
<Url>http://proazurestorage.queue.core.windows.net/testq2</Url>
</Queue>
<Queue>
<QueueName>testq3</QueueName>
<Url>http://proazurestorage.queue.core.windows.net/testq3</Url>
</Queue>
</Queues>
<NextMarker />
</EnumerationResults>


In Listing 2, the header consists of the HTTP status (200 OK) indicating the success of the operation. The response body is in XML format with <EnumerationResults /> as the root element. The <Queues /> element contains the retrieved queues. The Queue element encompasses queue attributes like the queue name and the queue URI. An empty <NextMarker /> element indicates that all the results have been retrieved.

To help you understand the Queue service programming model, open the Windows Azure Storage Operations project from Ch4Solution.sln. The project consists of a Windows form and uses the StorageClient project from the same solution for making calls to all the Windows Azure storage. The StorageClient project is shipped with the Windows Azure SDK. I also created a helper class named WindowsAzureStorageHelper in the ProAzureCommonLib project for wrapping the StorageClient methods. Figure 1 shows the user interface for the Windows Azure Storage Operations application as it pertains to the Operations account of the Queue service.

Figure 1. Windows Azure storage Queue service account operations

In Figure 1, the top Account section displays the account name and SharedKey of the storage account. When the Windows Azure Storage Operations.exe application starts, it loads the account information from the configuration file. Listing 3 shows the account configuration in the project's app.config file.

Example 3. App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key ="AccountName" value="proazurestorage"/>
<add key ="AccountSharedKey" value="RyyGrNJ4z5tViRWKR3QOJAK"/>
<add key="BlobStorageEndpoint" value="http://blob.core.windows.net"/>
<add key="QueueStorageEndpoint" value="http://queue.core.windows.net"/>
<add key="TableStorageEndpoint" value="http://table.core.windows.net"/>
<add key="LocalStorageAccountName" value="devstoreaccount1"/>
</appSettings>
</configuration>

The AccountName and AccountSharedKey values are loaded when the application starts and displays these values in the Account and Key text fields, respectively. When you start the application, make sure to enter the account name and shared key of your storage account. The QueueStorageEndpoint is the URI of the Queue service.

The WindowsAzureStorageHelper class in ProAzureCommonLib project has a ListQueue() method for retrieving queue names. Listing 4 shows the code for ListQueues() method.

Example 4. ListQueues() Method
public IEnumerable<MessageQueue> ListQueues(string prefix)
{
if (string.IsNullOrEmpty(prefix))

{
return this.QueueStorageType.ListQueues();
}
else
{
return this.QueueStorageType.ListQueues(prefix);
}
}

In Listing 5-7, the ListQueues() method calls the ListQueues() method on the QueueStorageType object, which is of type QueueStorage from the StorageClient assembly. In the QueueStorage class, there are two overloaded ListQueues() methods. The first one returns all the queues in an account, whereas the second one accepts a prefix as a filter term for filtering the queues by names. Figure 2 illustrate the execution of the ListQueues operation in the Windows Azure Storage Operations application.

Figure 2. List Queues operation

When you click the List Queues button, the application retrieves queues from the Queue service and displays the names of queues in the Queues ListBox. In the parameter section, you can specify the prefix.

Figure 3 is a sequence diagram for the ListQueues() method.

Figure 3. List Queues sequence diagram

In Figure 3, the Windows Azure Storage Operations application calls the ListQueues() method on the WindowsAzureStorageHelper object in the ProAzureCommonLib assembly. The helper object then calls the ListQueues() method on the QueueStorage and QueueStorageRest objects. QueueStorage is an abstract class, and QueueStorageRest inherits and implements the abstract methods from QueueStorage. The ListQueues() method in turn calls the private method ListQueuesImpl(). Finally, the actual logic for making the HTTP request to the Queue service is in the ListQueuesImpl() method. The Queue service returns the list of queues in an HTTP response, which is parsed and propagated back to the Windows Azure Storage Operations application for display.

Other -----------------
- Windows 7 : Removing an Icon from Control Panel
- Windows 7 : Showing Only Specified Control Panel Icons
- Windows 7 : Easier Access to Control Panel
- Windows 7 : Understanding Control Panel Files
- Windows 7 : Reviewing the Control Panel Icons
- Windows 7 : Touring the Control Panel Window
- Windows 7 : Reviewing Event Viewer Logs
- Windows 7 : Checking for Updates and Security Patchess
- Windows 7 : Backing Up Your Files
- Windows 7 : Preparing for Trouble
- Windows 7 : Defragmenting Your Hard Disk
- Windows 7 : Deleting Unnecessary Files
- Windows 7 : Checking Free Disk Space
- Windows 7 : Checking Your Hard Disk for Errors
- Windows Azure : Understanding Message Operations
- Windows Azure : Understanding Queue Operations
- Windows Azure Queue Overview
- Tuning Windows 7’s Performance : Optimizing Virtual Memory
- Tuning Windows 7’s Performance : Optimizing the Hard Disk
- Tuning Windows 7’s Performance : Optimizing Applications
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us